﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NamTrungBS.DataLayer;

namespace NamTrungBS
{
    public partial class LuuHoaDonForm : Form
    {
        LuuHoaDon hoadonSave = new LuuHoaDon();
        public LuuHoaDonForm(LuuHoaDon item)
        {
            hoadonSave = item;
            InitializeComponent();
            this.txtTen.Text = hoadonSave.TenHoaDon;
        }

        private void btnLuu_Click(object sender, EventArgs e)
        {
            hoadonSave.TenHoaDon = this.txtTen.Text;
            hoadonSave.MoTa = this.txtMota.Text;
            NamTrungDBDataContext db = new NamTrungDBDataContext();
            db.LuuHoaDons.InsertOnSubmit(hoadonSave);
            db.SubmitChanges();
            this.Close();
        }
    }
}
